#include <pthread.h>
#include <stdio.h>
#define NUM_THREADS     10 // define wat you want to define, reserving an array of threads structures
int long l[50];
int block=5;

void *PrintHello(void *threadid); // 

void *PrintHello(void *threadid) //
{
int n = (int) threadid;
for(int i=0;i<block;i++)
{
printf ("In PrintHello(): Hello World! It's me, thread %d \n",n);
printf ("l[%d]= %u\n",  i, rand ());
}
block=block+5;
}

int main (int argc, char *argv[]) 
{
   pthread_t threads[NUM_THREADS]; // each thread being created is taking an integer(array of 5 thread structures)
   for(int t = 0; t < NUM_THREADS; t++){ 
printf ("In main(): creating thread %d\n ", t);
       int rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
 // it takes an address of pthread structures, starting routine of the pthreads/  (void *) can be cast into the any data type     
                                        }
   /* Last thing that main() should do */
   pthread_exit(NULL); 
}
// in pthread create library--- (all possible data types)



